@tool
extends EditorProperty


# The main control for editing the property.
var property_control = Button.new()
var _script:Script

func _init():
	property_control.text = "Open"
	# Add the control as a direct child of EditorProperty node.
	add_child(property_control)
	# Make sure the control is able to retain the focus.
	add_focusable(property_control)
	# Setup the initial state and connect to the signal to track changes.
	property_control.pressed.connect(_on_button_pressed)




func _on_button_pressed():
	EditorInterface.set_main_screen_editor("Script")
	EditorInterface.edit_script(_script)
